package com.ruoyi.web.controller.user;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.Map;

@Controller
@ResponseBody
public class UserRent {
    @GetMapping("/rent")
    public Map<String,String> rent(@RequestBody Map<String,String> info, HttpSession session){
        if (session.getAttribute("user")==null){
            HashMap<String, String> Error = new HashMap<>();
            Error.put("info","抱歉，您没有权限，请先登录~");
            return Error;
        }
        HashMap<String, String> toFrame = new HashMap<>();
        System.out.println("Loading on rent.html");
        toFrame.put("redirect", "/user");
        return toFrame;
    }
}
